﻿<%@ Page Title="" Language="C#" MasterPageFile="~/backend/MasterPage_backend.master" AutoEventWireup="true" CodeFile="SalaryManagement.aspx.cs" Inherits="test_master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <!-- header-starts -->
			<div class="header-section">
				</div>
				<div class="header_bg">					
							<div class="header">
								<div class="head-t">
									<div class="logo">
										<a href="index.html"><img src="images/logo.png" class="img-responsive" alt=""> </a>
									</div>
										<!-- start header_right -->
									<div class="header_right">
										<div class="rgt-bottom">
										<div class="cart box_1">
											<a href="#">
												<h3> <span class="simpleCart_total">薪资管理系统 SalaryManagement</span></h3>
											</a>	
                                            <p>&nbsp;</p>
											<div class="clearfix"> </div>
										</div>
										<div class="clearfix"> </div>
									</div>
									<div class="search">
										<form>
											<input type="text" value="" placeholder="输入部门号查询：">
											<input type="submit" value="">
										</form>
									</div>
									<div class="clearfix"> </div>
								</div>
								<div class="clearfix"> </div>
							</div>
						</div>
					
				</div>
					<!-- //header-ends -->
<div class="content">
        <div class="fo-top-di">
        <%--上部信息--%>
	        <div class="foot-top">
            <div align=right>
				<asp:Button ID="Button1" runat="server" Text="新增职位并设定工资" 
                    onmouseover="this.style.backgroundColor='black';" 
                    onmouseout="this.style.backgroundColor='';" onclick="Button1_Click"/> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
                <asp:Button ID="Button2" runat="server" Text="取消新增" 
                    onmouseover="this.style.backgroundColor='black';" 
                    onmouseout="this.style.backgroundColor='';" onclick="Button2_Click"/>
             </div>
             <p>&nbsp;</p>
                <asp:Panel ID="Panel1" runat="server">        
                <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                    DataKeyNames="PosNo" DataSourceID="PositionDS" 
            DefaultMode="Insert" Height="140px" 
            Width="100%" HorizontalAlign="Center" BorderStyle="None" GridLines="None">
            <Fields>
                <asp:BoundField DataField="DpNo" HeaderText="部门编号(D)：" >
                <HeaderStyle BackColor="#F2F3F4" />
                <ItemStyle BackColor="#F2F3F4" HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="PosNo" HeaderText="职位编号(p)：" ReadOnly="True" 
                    SortExpression="PosNo">
                <HeaderStyle Width="150px" />
                <ItemStyle BorderStyle="None" BorderWidth="8px" HorizontalAlign="Left" 
                    Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="PosName" HeaderText="职位名称：" 
                    SortExpression="PosName" >
                <HeaderStyle BackColor="#F2F3F4" ForeColor="Black" />
                <ItemStyle BackColor="#F2F3F4" ForeColor="Black" HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="Salary" HeaderText="薪资：" SortExpression="Salary" >
                <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="操作：" ShowHeader="False">
                    <InsertItemTemplate>
                        <asp:Button ID="LinkButton1" runat="server" CausesValidation="True"  
                            onmouseover="this.style.backgroundColor='black';" onmouseout="this.style.backgroundColor='';"
                            CommandName="Insert" Text="新增" Width="100%" Height="38px" />

                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                            CommandName="New" Text="新建"></asp:LinkButton>
                    </ItemTemplate>
                    <HeaderStyle BackColor="#FFFFCC" Font-Bold="True" ForeColor="#990000" />
                    <ItemStyle BackColor="#F2F3F4" ForeColor="#CC0000" />
                </asp:TemplateField>
            </Fields>
        </asp:DetailsView>
        </asp:Panel>

			    <div class="clearfix"> </div>	            		
		    </div>
<%--下部信息--%>
            <div class="footer">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" DataKeyNames="PosNo" DataSourceID="PositionDS" 
            ForeColor="#333333" GridLines="None" Height="164px" style="text-align: center" 
            Width="100%" AllowPaging="True" EmptyDataText="未查询到结果" HorizontalAlign="Center">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="DpNo" HeaderText="部门编号" ReadOnly="True" >
                <HeaderStyle BackColor="Black" />
                </asp:BoundField>
                <asp:BoundField DataField="PosNo" HeaderText="职位编号" ReadOnly="True" 
                    SortExpression="PosNo" >
                    <ItemStyle HorizontalAlign="Center" />
                    <HeaderStyle HorizontalAlign="Center" BackColor="Black"  />
                 </asp:BoundField>
                <asp:BoundField DataField="PosName" HeaderText="职位名称" 
                    SortExpression="PosName" >
                    <ItemStyle HorizontalAlign="Center" />
                    <HeaderStyle HorizontalAlign="Center" BackColor="Black"  />
                    </asp:BoundField>
                <asp:BoundField DataField="Salary" HeaderText="薪资" SortExpression="Salary" >
                <ItemStyle HorizontalAlign="Center" />
                    <HeaderStyle HorizontalAlign="Center" BackColor="Black"  />
                    </asp:BoundField>
                <asp:CommandField HeaderText="操作" ShowDeleteButton="True" 
                    ShowEditButton="True" EditText="更改信息" UpdateText="确认更改" >
                <HeaderStyle HorizontalAlign="Center" BackColor="Black" />
                <ItemStyle ForeColor="#0066CC" Wrap="False" />
                </asp:CommandField>
            </Columns>
                <EditRowStyle HorizontalAlign="Center" Wrap="False" ForeColor="#990000" 
                    BackColor="#F2F3F4" Font-Italic="False" />
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" 
                    HorizontalAlign="Center" />
            <HeaderStyle BackColor="#b52e31" Font-Bold="True" ForeColor="White" 
                    HorizontalAlign="Center" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            <SortedAscendingCellStyle BackColor="#FDF5AC" />
            <SortedAscendingHeaderStyle BackColor="#4D0000" />
            <SortedDescendingCellStyle BackColor="#FCF6C0" />
            <SortedDescendingHeaderStyle BackColor="#820000" />
        </asp:GridView>
        <asp:SqlDataSource ID="PositionDS" runat="server" 
            ConnectionString="<%$ ConnectionStrings:HotelManagementConnectionString %>" 
            SelectCommand="SELECT * FROM [Position]" 
            UpdateCommand="UPDATE Position SET PosName = @PosName, Salary = @Salary WHERE (PosNo = @PosNo)" 
            DeleteCommand="DELETE FROM Position WHERE (PosNo = @PosNo)"      
            InsertCommand="INSERT INTO Position(DpNo,PosNo, PosName, Salary) VALUES (@DpNo,@PosNo, @PosName, @Salary)">
            <DeleteParameters>
                <asp:Parameter Name="PosNO" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="PosNo" />
                <asp:Parameter Name="PosName" />
                <asp:Parameter Name="Salary" />
                <asp:Parameter Name="DpNo" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="PosName" />
                <asp:Parameter Name="Salary" />
                <asp:Parameter Name="PosNo" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <p> </p>
	            <div class="clearfix"> </div>
		             <p>@ 2017 HotelManagement. All Rights Reserved | Design by <a href="#">us</a></p>
            </div>
        </div>
    </div>

</asp:Content>

